package juc.base;

public class DaemonThread {
    /*守护线程*/
    public static void main(String[] args) throws Exception {
        Thread t1 = new Thread(() -> {
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("t1");
        });
        t1.setDaemon(true);
        t1.start();
        System.out.println("end");
    }
}